#include<iostream>
#include<vector>
using namespace std;


int jewelleryValue(vector<vector<int>>& frame) {
	int length1 = frame.size(), length2 = frame[0].size();
	vector<int>temp(length2 + 1, 0);
	vector<vector<int>> dp(length1 + 1, temp);

	for (int i = 0; i <= length1; i++)
	{
		for (int j = 0; j <= length2; j++)
		{
			if (i == 0 || j == 0)
			{
				dp[i][j] = 0;
			}
			else
			{
				dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + frame[i - 1][j - 1];
			}
		}
	}
	return dp[length1][length2];
}
int main()
{

	return 0;
}